//
//  RankListCell.m
//  jingdongfang
//
//  Created by MTiMac01 on 2017/8/23.
//  Copyright © 2017年 LJL. All rights reserved.
//

#import "RankListCell.h"

@interface RankListCell ()

@property (weak, nonatomic) IBOutlet UIImageView *imageV;
@property (weak, nonatomic) IBOutlet UILabel *titleL;
@property (weak, nonatomic) IBOutlet UILabel *nameL;
@property (weak, nonatomic) IBOutlet UILabel *countL;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *imageWid;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *imageHei;
@property (weak, nonatomic) IBOutlet UILabel *numL;

@end
@implementation RankListCell

- (void)awakeFromNib
{
    [super awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
}

- (void)layoutSubviews
{
    [super layoutSubviews];

    if (_rowNum == 1)
    {
        _numL.textColor = [UIColor colorWithHex:@"#e81a1a"];
    }
    else if (_rowNum == 2)
    {
        _numL.textColor = [UIColor colorWithHex:@"#f1ae1e"];
    }
    else if (_rowNum == 3)
    {
        _numL.textColor = [UIColor colorWithHex:@"#399423"];
    }
    else
    {
        _numL.textColor = [UIColor c5Color];
    }
    _numL.text = [NSString stringWithFormat:@"%ld", _rowNum];
    
    _imageV.backgroundColor = [UIColor c6Color];
    [_imageV sd_setImageWithURL:[NSURL URLWithString:_list.image]];
    _titleL.text = _list.title;
    _nameL.text = _list.nike;
    
    if (_type == 0)
    {
//        _countL.text = [NSString stringWithFormat:@"%@人推送",_list.record];
        _countL.text = [NSString stringWithFormat:@"%@ %@",_list.record,NSLocalizedString(@"Pushes", nil)];
    }
    if (_type == 1)
    {
//        _countL.text = [NSString stringWithFormat:@"%@人收藏",_list.record];
        _countL.text = [NSString stringWithFormat:@"%@ %@",_list.record,NSLocalizedString(@"Collects", nil)];
    }
    if (_type == 2)
    {
//        _countL.text = [NSString stringWithFormat:@"%@人浏览",_list.record];
        _countL.text = [NSString stringWithFormat:@"%@ %@",_list.record,NSLocalizedString(@"Views", nil)];
    }
}

- (void)setType:(RankListType)type
{
    if (_type != type)
    {
        _type = type;
    }
}
@end
